import { initLocalDate, offlineQuickJob } from './offline.logic.js';
/**
 * onmessage
 * msg: { task, token, subscriptions, lifeCyclePeriod, offline }
 * @param msg
 * @author wds
 * @date 2022.12.26
 */
onmessage = function (msg) {
    let res = msg.data;
    console.warn('[offline] onmessage: ', res);
    if (res.offline)
        return initLocalDate({
            virtualVehicles: res.virtualVehicles,
            res: res.resources,
            randomStatusEnable: res.randomStatusEnable
        });
    else if (res.task === 'offlineQuickJob') return offlineQuickJob(res.data);
};
